<?php
/* @var $this AskController */
/* @var $data Ask */
?>

<li class="ask-list-item">
<table class="table">
    <tbody>
        <tr>
            <td width="10%" style="border-top:0px"><div class="reply_count" style="text-align: center"><?php echo CHtml::encode($data->replyCount); ?></div></td>
            <td style="border-top:0px"><?php echo CHtml::link(CHtml::encode($data->title), array('ask/view', 'id' => $data->ask_id)); ?></td>
            <td width="20%" style="border-top:0px"><span class="glyphicon glyphicon-user"></span>
                        <?php echo CHtml::encode($data->user->user_name); ?></td>
        </tr>
        <tr>
            <td style="border-top:0px"></td>
            <td style="border-top:0px">
            <div class="ask-body">
                <?php 
                $content = strip_tags($data->body);
                if (mb_strlen($content, 'utf-8') > 50)
                {
                    echo mb_substr($content, 0, 50, 'utf-8') . "...";
                }
                else
                {
                    echo $content;
                }
            ?> 
            </div>
            </td>
            <td style="border-top:0px">
                <span class="glyphicon glyphicon-eye-open"></span>
                <?php echo $data->hits; ?>
            </td>
        </tr>
    </tbody>
</table>
</li>
